home *** CD-ROM | disk | FTP | other *** search
/ Resident 2 / Resident - Issue 2 (19xx)(Angelica - SHI).adf / Data / 039 < prev    next >
Text File  |  1993-04-19  |  8KB  |  230 lines

  1. same routine, the subroutine carefully
  2. guards its pre-interrupt data.
  3.  
  4. ¶2  In  addition  to  learning  computer
  5. languages  and  computer architecture,
  6. the  student  can be expected to study
  7. operating   systems.   Even  here  the
  8. ¶368000  ¶2has some interesting attributes
  9. that make it particulary suitable as a
  10. teaching  machine.   For  example, all
  11. members  of the ¶368000 ¶2family support a
  12. dual  operating mode, not found on the
  13. 8086 family.  The ¶368000 ¶2can operate in
  14. a  supervisor  mode  or  a  user mode.
  15. When  it is in supervisor mode it runs
  16. the  operating system and controls all
  17. interrupts  and  exceptions  (software
  18. interrupts).   When it is in user mode
  19. it  runs programs - applications under
  20. control of the operating system.  This
  21. apparent schizophrenia serves a useful
  22. purpose:   the  operating system has a
  23. higher  state  of  privilege  than the
  24. user  state and users can be prevented
  25. from   carrying  out  operations  that
  26. would  compromise the integrity of the
  27. system.
  28.  
  29. ¶1  After   the   program   counter,   a
  30. computer's  most important register is
  31. its  stack pointer that keeps track of
  32. subroutine      return      addresses.
  33. Corrupting   the   stack   pointer  by
  34. careless   programming  or  by  faulty
  35. software  will  crash all the systems.
  36. The   ¶368000  ¶1actually  has  two  stack
  37. pointers, one for the operating system
  38. and  one  for  all  user applications.
  39. Whatever  a  user  does, the operating
  40. system's  own  stack pointer cannot be
  41. accessed  by  the user.  Therefore, if
  42. the  user  crashes an application, the
  43. operating   system  can  step  in  and
  44. gracefully  recover  (Now  THAT should
  45. someone  have  told to the programmers
  46. of  the  Amiga  OS.  Dotten's anm.) [I
  47. think they already know.  Cray's anm.]
  48.  
  49. ¶2  One of the things I emphasize is the
  50. design  of  robust  systems.  Whenever
  51. you're  beginning to think you must be
  52. paranoiac,   just  remember  that  the
  53. world  is  really  out to get you.  If
  54. you design mp system you should try to
  55. make  it  robust  and  able  to handle
  56. life's  little  problems.   Once more,
  57. the  ¶368000  ¶2has facilities that enable
  58. it  to  recover  from  a wide range of
  59. errors.   Consider  this  example.  In
  60. the   early  days  of  the  8-bit  mp,
  61. programmers  had  great fun trying out
  62. what    they    called   'undocumented
  63. op-codes'.   Not  all  possible binary
  64. codes    were    allocated    to   the
  65. instructions  documentated  in  a mp's
  66. data    sheet.     Programmers   tried
  67. executing these undefined op-codes and
  68. occasionally  they  found one that did
  69. something useful.
  70.  
  71. ¶1  I   have   nothing  against  experi-
  72. mentation,   but   a  few  programmers
  73. actually  started using undocumentated
  74. in their programs.  If you think for a
  75. moment,  a manufacturer is unlikely to
  76. provide  useful  instructions  and not
  77. tell the user.  These instructions may
  78. not  always  work.   For example, they
  79. may  fail if preceded by certain other
  80. instructions.   The manufacturer might
  81. change  the design of the chip and the
  82. undocumentated  instructions  may stop
  83. working.
  84.  
  85. ¶2  The ¶368000 ¶2checks each instruction as
  86. it  is executed.  If an op-code is not
  87. valid,   it   immediately  jumps  into
  88. supervisor  mode (if it wasn't already
  89. there)  and  calls  upon the operating
  90. system   to  deal  with  the  problem.
  91. Illegal   instructions   are   usually
  92. encountered  when  a processor makes a
  93. jump  to  a region of memory containig
  94. data    rather    than   instructions.
  95. Besides   its  ability  to  deal  with
  96. illegal  instructions,  the  ¶368000 ¶2can
  97. recover from problems that would cause
  98. many   other   processors   to   crash
  99. terminally.  Error recovery mechanisms
  100. exists  to deal with division by zero,
  101. attempts    to    read    faulty    or
  102. non-existent   memory,   and  spurious
  103. interrupts.
  104.  
  105. ¶1  So  far  we  have  talked  about the
  106. software   or   architecture   of  the
  107. processor.  I also teach the design of
  108. mp  systems.   Once  again,  the ¶368000
  109. ¶1makes  a  good vehicle for teaching mp
  110. interfacing techniques.  When teaching
  111. bus   protocols,  I  use  the  ¶368000¶1's
  112. asynchronous  bus cycle as an example.
  113. The  ¶368000  ¶1tells memory that it wants
  114. data  and  then  patiently waits until
  115. the  memory  provides  it.  Should the
  116. memory   not  deliver  data  whitin  a
  117. reasonable  time you can apply a pulse
  118. to a special pin to kick it out of its
  119. waiting  state  and  force  it to take
  120. action.   This  takes  us  back to the
  121. question of robustness.
  122.  
  123. ¶3Development
  124.  
  125. ¶2  Up  to  now I have talked only about
  126. the  ¶368000¶2.   Since Intel and Motorola
  127. have   access   to   the   same  basic
  128. technologies,   it  is  reasonable  to
  129. expect  that  development  in these to
  130. companies   take  place  in  paralell.
  131. Over  the  years  Intel  produced  the
  132. 8086,   80286,  80386  and  80486  (he
  133. forgot the 80186, no real wonder since
  134. it   have   never  been  used  in  any
  135. IBM-compitable   computers.   Dotten's
  136. anm.) and Motorola produced the ¶368000¶2,
  137. ¶368020¶2,  ¶368030 ¶2and ¶368040 ¶2(he forgot the
  138. 68010 but that is really just a ¶368000¶2.
  139. Dotten's  anm.) You might be surprised
  140. that  I  don't  concentrate heavily on
  141. these  much  more advanced devices, as
  142. the  basic  ¶368000  ¶2illustrates much of
  143. what  I  aim to teach.  I will briefly
  144. describe   the   way  in  which  these
  145. processors have been developed.
  146.  
  147. ¶1The ¶368020 ¶1is a super-¶368000 ¶1with full
  148. 32-bit   address   and   data   buses.
  149. Improvements   in  both  its  internal
  150. organization  and  design make it much
  151. faster  than  ¶368000¶1.   As  far  as the
  152. applications  programmer is concerned,
  153. the  ¶368020  ¶1has  the same registers as
  154. the  ¶368000¶1.   It  has  a  few  new in-
  155. structions   to  handle  complex  data
  156. structures.    Its   most  significant
  157. feature  is  its ability to handle bit
  158. fields.   Unlike  other processors the
  159. ¶368020 ¶1can move groups of between 1 and
  160. 32 bit bits from place irrespective of
  161. normal 8-bit boundaries.  This feature
  162. makes it suitable for image processing
  163. (probably   why   it  is  in  so  many
  164. post-script printers Dotten's anm.) or
  165. for the handling of data structures on
  166. disks.
  167.  
  168. ¶2  Time  may  prove  me  wrong,  but  I
  169. regard  the ¶368020 ¶2as the high point of
  170. mp    development.     Many    current
  171. developments in mp technology, such as
  172. RISC,  seem  to  aimed  at  increasing
  173. speed   or   adding  operating  system
  174. facilities.   For  example,  ¶368030  ¶2is
  175. virtually  the  same  the  same as the
  176. ¶368020  ¶2plus a sophisticated management
  177. system.    This   enhancement  doesn't
  178. speed  up  the processor's performance
  179. or  provide  the  programmer  with any
  180. useful  facilities.  Rather it permits
  181. the  use  of  operating  systems  like
  182. Unix,  enables  you  to  have  virtual
  183. memory  facilities and to run programs
  184. simultanously    with   each   program
  185. protected  from  corruption  by  other
  186. programs  (The  386 have an equivalent
  187. way  of  operate,  altough not used by
  188. MS/DR   DOS,   has   allowed  for  the
  189. development  of  OS/2  and Windows NT,
  190. which   are  both  multi-tasking  like
  191. Amiga-DOS.  Dotten's anm.)
  192.  
  193. ¶1  When  I teach memory systems design,
  194. I  cover  cache  memory.   A  cache is
  195. nothing  more  than a copy of recently
  196. accessed data which is kept in a small
  197. but fast (static ram, 'bout 10 ns, you
  198. get  them  external as well.  Dotten's
  199. anm.) When the processor requests data
  200. from  memory,  it  is probable that it
  201. will  find it in the fast cache memory
  202. rather   than   the   slower  external
  203. memory.  Both the ¶368020 ¶1and ¶368030 have
  204. on-chip  caches  -  the  ¶368020  ¶1caches
  205. instructions and the ¶368030 ¶1caches both
  206. instructions  and data.  (The 486 also
  207. have an onboard cache.  Dotten's anm.)
  208. These  are quite small caches but they
  209. enable   me   to   teach   the   basic
  210. principles.
  211.  
  212. ¶2  The   ¶368040   ¶2represents   a   major
  213. departure  from  the ¶368000 ¶2family.  It
  214. has a larger on board cache.  Than the
  215. ¶368030   ¶2and   and  two  MMU's  (memory
  216. management units), one for accesses to
  217. data   and   one   for   accesses   to
  218. instructions   so   it   can  read  an
  219. instruction  and  data simoultanously.
  220. It  also has an on-chip floating point
  221. co-processor.
  222.  
  223. ¶1  I  use  the  computer  as  an aid to
  224. teaching  and not as an end in itself.
  225. Consequently,   I  shall  continue  to
  226. build  my  courses  around  the  68000
  227. family.   My  only  regret is that IBM
  228. didn't  make  the  same decision a few
  229. years ago....
  230.